<template>
  <h1 class="title">前端学习</h1>
  <div class="navigate">
    <RouterLink :to="{ path: '/home' }" class="active">首页</RouterLink>
    <RouterLink :to="{ path: '/demo' }" class="active">项目</RouterLink>
    <RouterLink :to="{ path: '/note' }" class="active">笔记</RouterLink>
    <!-- <RouterLink :to="{ name:'note' }" class="active">笔记</RouterLink> 名字跳转or路径跳转-->
  </div>
  <div class="content" style="position: relative;">
    <RouterView></RouterView>
  </div>

</template>

<script setup lang="ts" name="App">
//import Person from './components/person.vue';// 引入组件,setup中自动return
import { RouterView, RouterLink } from 'vue-router';
</script>

<style>
/* App */
.title {
  text-align: center;
  word-spacing: 5px;
  margin: 30px 0;
  height: 70px;
  line-height: 70px;
  background-image: linear-gradient(45deg, gray, white);
  border-radius: 10px;
  box-shadow: 0 0 2px;
  font-size: 30px;
}

.navigate {
  display: flex;
  justify-content: space-around;
  margin: 0 100px;
}

.navigate a {
  display: block;
  text-align: center;
  width: 90px;
  height: 40px;
  line-height: 40px;
  border-radius: 10px;
  background-color: gray;
  text-decoration: none;
  color: white;
  font-size: 18px;
  letter-spacing: 5px;
}

.navigate a.active {
  background-color: #1268e9;
  color: #f8f8f6;
  font-weight: 900;
  text-shadow: 0 0 1px black;
  font-family: 微软雅黑;
}

.content {
  margin: 0 auto;
  margin-top: 30px;
  border-radius: 10px;
  width: 90%;
  height: 400px;
  border: 1px solid;
}
</style>
